Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Managing Controller States

QuickDraw 3D provides routines that you can use to save and restore the states of all the channels associated with a controller. You should save the controller states when your application becomes inactive and restore them when it becomes active once again.

Q3ControllerState_New

You can use the Q3ControllerState_New function to create a new controller state object.

TQ3ControllerStateObject Q3ControllerState_New (
                     TQ3ControllerRef controllerRef);
controllerRef
A reference to a controller.

DESCRIPTION

The Q3ControllerState_New function returns, as its function result, a reference to a new controller state object for the controller specified by the controllerRef parameter. You need to call Q3ControllerState_SaveAndReset to actually fill in the new controller state object with the current channels. If Q3ControllerState_New cannot create a new controller state object, it returns NULL .

Q3ControllerState_SaveAndReset

You can use the Q3ControllerState_SaveAndReset function to save the current state of a controller.

TQ3Status Q3ControllerState_SaveAndReset (
                     TQ3ControllerStateObject controllerStateObject);
controllerStateObject
A controller state object.

DESCRIPTION

The Q3ControllerState_SaveAndReset function saves the current state of the controller that is associated with the controller state object specified by the controllerStateObject parameter. Q3ControllerState_SaveAndReset also resets those channels to their inactive states. You should call Q3ControllerState_SaveAndReset to save a controller's channels when your application becomes inactive.

Q3ControllerState_Restore

You can use the Q3ControllerState_Restore function to restore a saved set of controller state values.

TQ3Status Q3ControllerState_Restore (
                     TQ3ControllerStateObject controllerStateObject);
controllerStateObject
A controller state object.

DESCRIPTION

The Q3ControllerState_Restore function sets the channels of the controller associated with the controller state object specified by the controllerStateObject parameter to the channels saved in that state object.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |